From 23a063c1bd4219646165d8348da489ba14da5b0b Mon Sep 17 00:00:00 2001 From: "gm281@boulderdash.cl.cam.ac.uk" Date: Thu, 8 Jul 2004 18:10:17 +0000 Subject: [PATCH] bitkeeper revision 1.1054 (40ed8e097hqWQ3yDtTM5H6XnNbggVQ) Minor changes to make xen compile when debugging is switched on. --- xen/common/debug.c | 1 + xen/common/domain.c | 2 ++ xen/common/sched_fair_bvt.c | 30 +++++++++++++++++++----------- xen/common/schedule.c | 1 - 4 files changed, 22 insertions(+), 12 deletions(-) diff --git a/xen/common/debug.c b/xen/common/debug.c index 1cf4c57d37..b17748a864 100644 --- a/xen/common/debug.c +++ b/xen/common/debug.c @@ -12,6 +12,7 @@ #include #include #include +#include #undef DEBUG_TRACE #ifdef DEBUG_TRACE diff --git a/xen/common/domain.c b/xen/common/domain.c index 76d0f61df1..3df97a7e25 100644 --- a/xen/common/domain.c +++ b/xen/common/domain.c @@ -11,6 +11,8 @@ #include #include #include +#include +#include /* Both these structures are protected by the tasklist_lock. */ rwlock_t tasklist_lock __cacheline_aligned = RW_LOCK_UNLOCKED; diff --git a/xen/common/sched_fair_bvt.c b/xen/common/sched_fair_bvt.c index f20b754ab4..a7aa0335cf 100644 --- a/xen/common/sched_fair_bvt.c +++ b/xen/common/sched_fair_bvt.c @@ -1,19 +1,20 @@ /* -*- Mode:C; c-basic-offset:4; tab-width:4 -*- **************************************************************************** - * (C) 2002-2003 - Rolf Neugebauer - Intel Research Cambridge - * (C) 2002-2003 University of Cambridge - * (C) 2004 - Mark Williamson - Intel Research Cambridge + * (C) 2004 Grzegorz Milos - University of Cambridge + * Based on the implementation of the BVT scheduler by Rolf Neugebauer + * and Mark Williamson (look in sched_bvt.c) **************************************************************************** * - * File: common/schedule.c - * Author: Rolf Neugebauer & Keir Fraser - * Updated for generic API by Mark Williamson + * File: common/sched_fair_bvt.c + * Author: Grzegorz Milos * * Description: CPU scheduling - * implements A Borrowed Virtual Time scheduler. - * (see Duda & Cheriton SOSP'99) + * implements Fair Borrowed Virtual Time Scheduler. + * FBVT is modification of BVT (see Duda & Cheriton SOSP'99) + * which tries to allocate fair shares of processor even + * when there is mix between CPU and I/O bound domains. + * TODO - more information about the scheduler in TODO */ - #include #include #include @@ -25,6 +26,10 @@ #include #include #include +#include + +/* For tracing - TODO - put all the defines in some common hearder file */ +#define TRC_SCHED_FBVT_DO_SCHED 0x00020000 /* all per-domain BVT-specific scheduling info is stored here */ @@ -171,7 +176,7 @@ void fbvt_wake_up(struct domain *p) */ io_warp = (int)(0.5 * inf->time_slept); - if(io_warp > 10000) io_warp = 10000; + if(io_warp > 1000) io_warp = 1000; ASSERT(inf->time_slept + CPU_SVT(p->processor) > inf->avt + io_warp); inf->time_slept += CPU_SVT(p->processor) - inf->avt - io_warp; @@ -429,13 +434,16 @@ static task_slice_t fbvt_do_schedule(s_time_t now) r_time = ((next_prime_inf->evt + next_inf->vtb - next_inf->evt)/next_inf->mcu_advance) + ctx_allow; - + ASSERT(r_time >= ctx_allow); sched_done: + + TRACE_2D(TRC_SCHED_FBVT_DO_SCHED, next->domain, r_time); next->min_slice = ctx_allow; ret.task = next; ret.time = r_time; + return ret; } diff --git a/xen/common/schedule.c b/xen/common/schedule.c index ec4971f4d0..f31fab94fc 100644 --- a/xen/common/schedule.c +++ b/xen/common/schedule.c @@ -381,7 +381,6 @@ void __enter_scheduler(void) rem_ac_timer(&schedule_data[cpu].s_timer); ASSERT(!in_irq()); -if(!__task_on_runqueue(prev)) printk("Domain %d not on runqueue\n",prev->domain); ASSERT(__task_on_runqueue(prev)); if ( test_bit(DF_BLOCKED, &prev->flags) ) -- 2.30.2